Feed CLI errors into Datadog Error Tracking#87
Merged
Conversation
Failures now ship status:error plus the reserved error.kind attribute (set to the anonymous error_type — e.g. api_error, not_authenticated), which is Datadog's documented requirement to promote a log into Error Tracking (issue grouping, first-/last-seen, regression detection, alerting). No error message or stack trace rides along, so the privacy contract is unchanged — issues group by error type x command, not stack. Successes stay info logs with no error namespace. Both reference CLIs this telemetry is modeled on keep their always-on stream message-free (Vercel never sends serialized errors; Supabase ships only exit_code via PostHog and gates stack traces behind an opt-in --create-ticket path), so this stays within that bar. Dashboard: error tiles now filter on the canonical status:error, the header note documents the new fields, and a new "All errors by frequency (type x command)" table lists every error ranked by occurrence. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alexkroman
enabled auto-merge (squash)
June 12, 2026 00:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Promotes CLI failures into Datadog Error Tracking with zero new PII, and updates the dashboard to match.
aai_cli/telemetry.py—build_eventnow, on a failure:status: error(successes stayinfo)error.kind= the anonymousoutcome(CLIError.error_type, e.g.api_error,not_authenticated)status:error+error.kindis exactly Datadog's documented requirement to feed Error Tracking (issue grouping, first-/last-seen, regression detection, alerting). The error message and stack trace are deliberately omitted — no free text leaves the machine — so issues group by error type × command, not by stack.Why this shape (not inline messages)
Both CLIs this telemetry is modeled on keep their always-on stream message-free:
exit_codevia PostHog, and gates full stack traces behind an explicit opt-in--create-ticket→ Sentry path.So shipping only the error type stays within that bar. A message/stack tier remains deferred behind a future opt-in path.
Dashboard
status:error(equivalent to the old-@outcome:success, but Error-Tracking-native).status:error/@error.kindfields.Note
Pre-existing failure logs won't be retroactively tagged — Error Tracking populates from new CLI versions onward (or a one-time Datadog log remapper).
Verification
./scripts/check.sh→ All checks passed. (1728 tests, 100% patch coverage on the diff, mutation gate clean, build + twine OK).🤖 Generated with Claude Code